package main

import "fmt"

type Person struct {
	name string
	age int
}

func (p *Person) printPerson()  {
	fmt.Println(" p =", *p)
}

type Student struct {
	Person	// 其变量、方法都会继承
	id int
}

func (s *Student) printStudent()  {
	fmt.Println("s =", *s)
}

func main() {
	s := Student{Person{"mike", 11}, 1}
	s.printStudent()	//  s = {{mike 11} 1}
}
